package com.bw.lib_log.impl;

import android.util.Log;

import com.bw.lib_log.ILogger;
import com.bw.lib_log.LoggerLevel;

/**
 * @ClassName LogcatImpl
 * @Author hu..
 * @Data 2024/7/22
 * @Description
 */
public class LogcatImpl implements ILogger {

    private String logFormat = "===> %s ---- %s";

    @Override
    public void v(String tag, String log) {
        if(mIsDebug && LoggerLevel.Verbose.ordinal() >= mLevel.ordinal()){
            Log.v(mTag,String.format(logFormat,tag,log));
        }
    }

    @Override
    public void i(String tag, String log) {

    }

    @Override
    public void d(String tag, String log) {

    }

    @Override
    public void w(String tag, String log) {

    }

    @Override
    public void e(String tag, String log) {

    }

    private boolean mIsDebug=false;
    @Override
    public void setDebug(boolean isDebug) {
        mIsDebug=isDebug;
    }

    private String mTag="123";
    @Override
    public void setLogTag(String tag) {
        this.mTag=tag;
    }

    private LoggerLevel mLevel=LoggerLevel.Verbose;
    @Override
    public void setLoggerLevel(LoggerLevel level) {
        this.mLevel=level;
    }
}
